//
// Created by Administrator on 2023/7/28.
//
#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
    int differenceOfSum(vector<int> &nums) {
        int eleSum = 0;
        int numSum = 0;
        for (int x: nums) {
            eleSum += x;
            //数字和
            while (x) {
                numSum += x % 10;
                x /= 10;
            }
        }
        return abs(eleSum - numSum);
    }
};

int main() {
    Solution s;
    vector<int> nums1{1, 15, 6, 3};
    vector<int> nums2{1, 2, 3, 4};
    vector<int> nums3{2, 7, 8, 10, 8, 10, 1, 10, 5, 9};
//    cout << s.differenceOfSum(nums1) << endl;
//    cout << s.differenceOfSum(nums2) << endl;
    cout << s.differenceOfSum(nums3) << endl;


}